<template>
  <div id="AI-box">
    <main class="main">
      <div class="min-nav-bg">
        <div class="analysis-nav AI-MAW">
          <div class="analysis-nav-tit">
            <a :href="BASE_URL" class="logo-c">
              <img v-if="logoUrl" :src="BASE_URL + logoUrl" alt="logo" />
              <img v-else src="../../../../public/logo.png" alt="logo" />
            </a>
            <span v-if="logoTxt" class="logo-txt">{{ logoTxt }}</span>
            <i>·</i>
            <span>教学AI</span>
          </div>
          <div class="el-menu-ai">
            <el-menu class="el-menu-demo" :default-active="activeIndex" mode="horizontal" @select="selectMenuTab">
              <el-menu-item index="1">
                <router-link to="/analysis">课堂分析</router-link>
              </el-menu-item>
              <el-menu-item index="2">
                <router-link to="/analysis/compare-class">授课对比</router-link>
              </el-menu-item>
              <el-menu-item index="3">
                <router-link to="/analysis/score">成绩分析</router-link>
              </el-menu-item>
            </el-menu>
          </div>
        </div>
      </div>
      <router-view />
    </main>
  </div>
</template>
<script>
export default {
  data() {
    return {
      baseUrl: process.env.BASE_URL,
      activeIndex: "1",
      logoUrl: sessionStorage.getItem("logoUrl"),
      logoTxt: sessionStorage.getItem("siteTitle")
    };
  },
  created() {
    this.activeIndex = is_empty(sessionStorage.getItem("activeIndex")) ? "1" : sessionStorage.getItem("activeIndex");
  },
  methods: {
    selectMenuTab(inx, inx_path) {
      this.activeIndex = inx + "";
      sessionStorage.setItem("activeIndex", inx + "");
    }
  }
};
</script>
<style lang="scss">
#AI-box {
  background-image: url("../../../../public/images/analysis/bgc.png");
  background-size: 100% 100%;
}

.main {
  height: calc(100% - 45px);
}

.min-nav-bg {
  background-color: #081736;
}

.analysis-nav {
  position: relative;
  height: 60px;
  line-height: 60px;

  // overflow: hidden;
  .analysis-nav-tit {
    display: inline-block;
    height: 60px;
    padding-right: 40px;
    position: absolute;
    left: 0;
    top: 0;
    > a {
      display: inline-block;
      vertical-align: top;
      background: #0000;
      margin-left: 10px;
    }
    img {
      vertical-align: middle;
    }

    h2 {
      display: inline-block;
      vertical-align: middle;
      font-size: 30px;
      font-weight: 600;
      color: #fff;
      padding-left: 5px;
    }

    i,
    span {
      vertical-align: middle;
      font-size: 18px;
      color: #fff;
      padding-left: 10px;
    }

    i {
      font-size: 30px;
    }
  }

  .el-menu-ai {
    display: inline-block;
    width: calc(100% - 530px);
    margin-left: 530px;

    .el-menu.el-menu--horizontal {
      border-bottom: none;
      background-color: #081736;

      .el-menu-item {
        width: 134px;
        text-align: center;
        padding: 0;
        height: 60px;
        line-height: 60px;
        border-bottom: none;
        color: #fff;
      }

      .el-menu-item:hover {
        background-color: rgba(48, 78, 140, 0.1);
      }

      .el-menu-item.is-active {
        font-weight: 600;
        background-color: #304e8c;
        border-bottom: none;
        border-bottom-color: #304e8c;
      }

      .el-menu-item a {
        display: block;
      }
    }
  }
}

@import "./../../../assets/css/analysis.scss";
</style>
